<?php

namespace App\Http\Controllers\Api\V1\Requests;

use App\Models\User;

class AuthAlipayBindRequest extends FormRequest
{
    public function rules()
    {
	    if (!$this->user()->pay_code) {
		    fail('请先设置交易密码');
	    }

	    return [
		    'code' => 'required|string',
		    'pay_code' => $this->paycode()
	    ];
    }

    public function attributes()
    {
	    return [
	    	'pay_code' => '交易密码'
	    ];
    }
}
